HAL CORDIC Overview ¶
Introducing CORDIC ¶
- group CORDIC_Introduction
-
The Hardware Abstraction Layer CORDIC provides an efficient interface to the hardware CORDIC coprocessor, which accelerates mathematical functions commonly used in motor control, metering, signal processing, and other embedded applications.
It supports a variety of functions including sine, cosine, hyperbolic sine and cosine, arctangent, modulus, square root, and natural logarithm, enabling flexible use across different computational needs.
The CORDIC HAL allows configurable precision, scaling factors, and flexible settings for the number and width of input arguments and output results to optimize performance and data handling.
The HAL CORDIC provides calculation modes including polling, zero-overhead, interrupt, and DMA to accommodate different application requirements.
These features simplify the integration of complex mathematical calculations in embedded systems, improving performance and offloading the processor to handle other processes.
Module and files ¶
The following diagram illustrates the CORDIC module and its associated files.
Component diagram ¶
The following diagram illustrates the software components involved in the CORDIC module. It shows the interactions between the user application, HAL drivers, low-level drivers, and the hardware components.
Configuration table ¶
The following table lists the configuration defines for the HAL CORDIC module, specifying their locations, default values, and descriptions:
- group CORDIC_Configuration_Table
-
Configuration inside the CORDIC driver ¶
Software configuration defined in stm32c5xx_hal_conf.h:
preprocessor flags
Default value
Comment
USE_HAL_CORDIC_MODULE
1
Enable HAL CORDIC driver module
USE_HAL_CORDIC_REGISTER_CALLBACKS
0
Allow the user to define their own callback
USE_HAL_CORDIC_DMA
1
Enable DMA code inside CORDIC
USE_HAL_CHECK_PARAM
0
Enable runtime parameter check
USE_HAL_CORDIC_CLK_ENABLE_MODEL
HAL_CLK_ENABLE_NO
Enable the gating of the peripheral clock
USE_HAL_CHECK_PROCESS_STATE
0
Enable atomicity of process state check
USE_HAL_CORDIC_USER_DATA
0
Add a user data inside HAL CORDIC handle
USE_HAL_CORDIC_GET_LAST_ERRORS
0
Enable retrieval of last processes error codes
Software configuration defined in preprocessor environment:
preprocessor flags
Default value
Comment
USE_ASSERT_DBG_PARAM
Not defined
Enable check param for HAL and LL
USE_ASSERT_DBG_STATE
Not defined
Enable check state for HAL